package net.gaox.random.config.port;

import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationListener;

/**
 * <p> 端口 事件监听器 </p>
 *
 * @author gaox·Eric
 * @date 2020/5/22 00:10
 */
public class PortEnvironmentPreparedEventListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent> {

    @Override
    public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
        event.getEnvironment().getPropertySources().addLast(new PortPropertySource());
    }

}
